package com.wangshuqi.jdbc.dao;

import com.wangshuqi.jdbc.bean.Customer;

import java.sql.Connection;
import java.util.List;

public interface CustomerDAO {

    /**
     * 新增客户
     *
     * @param connection customer
     * @return int
     * @author codewsq
     * @date 2021/8/27 0027 10:41
     */
    int insertCustomer(Connection connection, Customer customer);

    /**
     * 根据id修改客户
     *
     * @param connection customer
     * @return int
     * @author codewsq
     * @date 2021/8/27 0027 10:41
     */
    int updateById(Connection connection, Customer customer);

    /**
     * 根据id删除客户
     *
     * @param connection id
     * @return int
     * @author codewsq
     * @date 2021/8/27 0027 10:42
     */
    int deleteById(Connection connection, Integer id);

    /**
     * 根据id查询客户
     *
     * @param connection id
     * @return com.wangshuqi.jdbc.bean.Customer
     * @author codewsq
     * @date 2021/8/27 0027 10:42
     */
    Customer selectById(Connection connection, Integer id);

    /**
     * 查询全部客户
     *
     * @param connection
     * @return java.util.List<com.wangshuqi.jdbc.bean.Customer>
     * @author codewsq
     * @date 2021/8/27 0027 10:42
     */
    List<Customer> selectAll(Connection connection);

    /**
     * 查询客户数量
     *
     * @param connection
     * @return java.lang.Long
     * @author codewsq
     * @date 2021/8/27 0027 10:42
     */
    Long count(Connection connection);
}
